/* 
 * Copyright (c) 2016 Qualcomm Technologies, Inc. 
 * All Rights Reserved. 
 * Qualcomm Technologies, Inc. Confidential and Proprietary. 
 */
package com.thunder.rebot.rebotclient.vam.entity;

import android.graphics.RectF;

/**
 * Class for face frame
 */
public class FaceFrame {
    private int absence;
    private String id = null;
    private RectF frame = new RectF();

    public String getDisplay_name() {
        return display_name;
    }

    public void setDisplay_name(String display_name) {
        this.display_name = display_name;
    }

    private String display_name=null;

    /**
     * Constructor for the class
     *
     * @param id       face id
     * @param faceRect face rect
     */
    public FaceFrame(String id, RectF faceRect) {
        this.id = id;
        absence = 1;
        frame.set(faceRect);
    }

    /**
     * Constructor for the face frame
     *
     * @param id     frame id
     * @param left   rect left
     * @param top    rect top
     * @param right  rect right
     * @param bottom rect bottom
     */
    public FaceFrame(String id, int left, int top, int right, int bottom) {
        this(id, new RectF(left, top, right, bottom));
    }

    /**
     * get method for face frame
     *
     * @return face rect
     */
    public RectF getRect() {
        return frame;
    }

    /**
     * method to get the frame id
     *
     * @return frame id
     */
    public String getId() {
        return id;
    }

    /**
     * get the absence count
     *
     * @return absence count
     */
    public int getAbsence() {
        return absence;
    }

    /**
     * notify the face absence
     */
    public void NotifyNotThere() {
        absence++;
    }

    /**
     * notify the face presence
     */
    public void notifyThere() {
        absence = 1;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return "FR: " + frame + ", abs: " + absence;
    }

    /**
     * updates the rect
     * @param newRect new rect
     */
    public void setRect(RectF newRect) {
        frame.set(newRect);
    }
}
